<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>壁纸APP - 视频预览</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        :root {
            --primary-color: #007AFF;
            --bg-color: #f5f5f5;
            --text-color: #333;
            --card-bg: #fff;
            --border-color: #f5f5f5;
            --secondary-text: #999;
            --shadow-color: rgba(0,0,0,0.1);
            --highlight-color: #f0f7ff;
            --video-controls-bg: rgba(0,0,0,0.7);
            --video-progress-color: #007AFF;
        }
        
        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
            background-color: var(--bg-color);
            color: var(--text-color);
            transition: all 0.3s ease;
        }

        /* 顶部标题栏 */
        .header {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            height: 44px;
            background: var(--card-bg);
            padding: 8px 16px;
            display: flex;
            align-items: center;
            box-shadow: 0 1px 3px var(--shadow-color);
            z-index: 100;
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
        }

        .back-button {
            font-size: 18px;
            color: var(--primary-color);
            margin-right: 16px;
            cursor: pointer;
            transition: transform 0.2s ease;
        }

        .back-button:hover {
            transform: translateX(-2px);
        }

        .header-title {
            font-size: 18px;
            font-weight: 500;
            flex: 1;
            color: var(--text-color);
        }



        /* 视频播放区域 */
        .video-container {
            margin-top: 44px;
            width: 100%;
            background: #000;
            position: relative;
            overflow: hidden;
        }

        .video-player {
            width: 100%;
            aspect-ratio: 16/9;
            background: #000;
            object-fit: cover;
        }

        /* 自定义视频控制器 */
        .video-controls {
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            background: var(--video-controls-bg);
            padding: 10px;
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .video-container:hover .video-controls {
            opacity: 1;
        }

        .progress-bar {
            width: 100%;
            height: 4px;
            background: rgba(255,255,255,0.3);
            border-radius: 2px;
            cursor: pointer;
            margin-bottom: 10px;
        }

        .progress {
            width: 0;
            height: 100%;
            background: var(--video-progress-color);
            border-radius: 2px;
            position: relative;
        }

        .progress-handle {
            width: 12px;
            height: 12px;
            background: var(--primary-color);
            border-radius: 50%;
            position: absolute;
            right: -6px;
            top: 50%;
            transform: translateY(-50%);
            box-shadow: 0 0 5px rgba(0,0,0,0.3);
        }

        /* 视频信息区域 */
        .video-info {
            background: var(--card-bg);
            padding: 20px;
            margin-bottom: 10px;
            border-radius: 0 0 16px 16px;
            box-shadow: 0 2px 8px var(--shadow-color);
        }

        .video-title {
            font-size: 20px;
            font-weight: 600;
            margin-bottom: 12px;
            color: var(--text-color);
        }

        .video-stats {
            display: flex;
            gap: 20px;
            color: var(--secondary-text);
            font-size: 14px;
            margin-bottom: 20px;
        }

        .action-buttons {
            display: flex;
            justify-content: space-around;
            padding: 16px 0;
            border-top: 1px solid var(--border-color);
        }

        .action-button {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 6px;
            color: var(--text-color);
            text-decoration: none;
            transition: transform 0.2s ease;
        }

        .action-button:hover {
            transform: translateY(-2px);
        }

        .action-button i {
            font-size: 24px;
            color: var(--primary-color);
        }

        .action-button span {
            font-size: 12px;
            color: var(--secondary-text);
        }

        /* 视频描述 */
        .video-description {
            background: var(--card-bg);
            padding: 20px;
            margin-bottom: 10px;
            border-radius: 16px;
            box-shadow: 0 2px 8px var(--shadow-color);
        }

        .description-title {
            font-size: 16px;
            font-weight: 600;
            margin-bottom: 12px;
            color: var(--text-color);
        }

        .description-content {
            font-size: 14px;
            color: var(--secondary-text);
            line-height: 1.6;
        }






    </style>
</head>
<body>
    <!-- 顶部标题栏 -->
    <div class="header">
        <div class="back-button" onclick="history.back()">
            <i class="fas fa-arrow-left"></i>
        </div>
        <h1 class="header-title" id="video-title">视频标题</h1>
    </div>

    <!-- 视频播放区域 -->
    <div class="video-container">
        <video class="video-player" id="video-player">
            <source src="" type="video/mp4">
            您的浏览器不支持视频播放。
        </video>
        <div class="video-controls">
            <div class="progress-bar" id="progress-bar">
                <div class="progress" id="progress">
                    <div class="progress-handle"></div>
                </div>
            </div>
        </div>
    </div>

    <!-- 视频信息 -->
    <div class="video-info">
        <h2 class="video-title" id="info-title">视频标题</h2>
        <div class="video-stats">
            <span id="view-count">0 次观看</span>
        </div>
        <div class="action-buttons">
            <a class="action-button" onclick="saveVideo()">
                <i class="fas fa-save"></i>
                <span>保存</span>
            </a>
        </div>
    </div>

    <!-- 视频描述 -->
    <div class="video-description">
        <h3 class="description-title">视频简介</h3>
        <p class="description-content" id="video-description">视频描述内容</p>
    </div>



    <script>
        // 获取URL参数
        const urlParams = new URLSearchParams(window.location.search);
        const videoId = urlParams.get('id');
        const videoTitle = urlParams.get('title');
        const videoUrl = urlParams.get('video');
        const thumbnailUrl = urlParams.get('thumbnail');

        // 更新页面内容
        document.getElementById('video-title').textContent = videoTitle;
        document.getElementById('info-title').textContent = videoTitle;
        document.getElementById('video-player').src = videoUrl || 'https://samplelib.com/lib/preview/mp4/sample-5s.mp4';

        // 模拟数据
        const viewCount = Math.floor(Math.random() * 100000);
        document.getElementById('view-count').textContent = `${viewCount.toLocaleString()} 次观看`;
        document.getElementById('video-description').textContent = `这是一段关于${videoTitle}的精彩视频，展示了令人惊叹的画面和内容。`;



        // 保存视频功能
        function saveVideo() {
            alert('视频已保存到本地收藏夹');
        }

        // 保存视频功能
        function saveVideo() {
            alert('视频已保存到本地收藏夹');
        }




        // 视频进度条
        const video = document.getElementById('video-player');
        const progressBar = document.getElementById('progress-bar');
        const progress = document.getElementById('progress');

        // 初始化视频控制
        video.addEventListener('loadedmetadata', () => {
            // 视频加载完成后的初始化
            console.log('视频已加载，时长：', video.duration);
        });

        video.addEventListener('timeupdate', () => {
            const percentage = (video.currentTime / video.duration) * 100;
            progress.style.width = `${percentage}%`;
        });

        progressBar.addEventListener('click', (e) => {
            const rect = progressBar.getBoundingClientRect();
            const pos = (e.clientX - rect.left) / progressBar.offsetWidth;
            video.currentTime = pos * video.duration;
        });
        
        // 添加键盘控制
        document.addEventListener('keydown', (e) => {
            if (e.code === 'Space') {
                // 空格键暂停/播放
                if (video.paused) video.play();
                else video.pause();
                e.preventDefault();
            }
        });
    </script>
</body>
</html>
